package com.itheima.yanshi;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

public class Demo04 {


    public static void main(String[] args) throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException {

        Class clazz = Class.forName("com.itheima.Singer");
        Object o = clazz.getConstructor().newInstance();
        Method[] methods = clazz.getDeclaredMethods();
        for (Method method : methods) {
            method.invoke(o);
        }


    }
}
